package com.itheima.dao;

import com.itheima.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @author benben278
 * @create 2022-03-18 20:46
 */
@Mapper
public interface RoleDao {
    //根据用户id查询关联的角色
    @Select("select  r.* from t_role r ,t_user_role ur where r.id = ur.role_id and ur.user_id = #{userId}")
    Set<Role> findByUserId(int id);
}
